<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/mytags.jsp"%>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<%@ include file="/common/easyui.jsp"%>

<script type="text/javascript">
	//菜单json
	var menus = [
	    {"id":"1","pid":"0","name":"顶级菜单","href":"","icon":"icon-nav"}
	    //一级菜单
	    ,{"id":"2","pid":"1","name":"权限管理","href":"","icon":"icon-nav"}
	    ,{"id":"3","pid":"1","name":"自动生成","href":"","icon":"icon-nav"}
	    ,{"id":"4","pid":"1","name":"运行监控","href":"","icon":"icon-nav"}
	    //二级菜单
	    ,{"id":"5","pid":"2","name":"机构用户","href":"","icon":"icon-nav"}
	    ,{"id":"6","pid":"2","name":"机构用户1","href":"","icon":"icon-nav"}
	    ,{"id":"7","pid":"3","name":"自动生成","href":"","icon":"icon-nav"}
	    ,{"id":"8","pid":"3","name":"自动生成1","href":"","icon":"icon-nav"}
	    ,{"id":"9","pid":"3","name":"自动生成2","href":"","icon":"icon-nav"}
	    //三级菜单
	    ,{"id":"10","pid":"5","name":"用户管理","href":"/adminManage/sys/sysUser/list.do","icon":"icon-nav"}
	    ,{"id":"11","pid":"5","name":"机构管理","href":"/adminManage/sys/sysOffice/list.do","icon":"icon-nav"}
	];
	
	$(function() {
		var topMenu='';
		$.each(menus,function(j,o){
			if(o.pid==1)
				topMenu+="<a href=\"javascript:void(0)\" onclick=\"leftMenu('"+o.id+"','${ctx}"+o.href+"')\">"+o.name+"</a>";
		});
		//$("#topMenu").html(topMenu);
		//alert($("#topMenu").height());
	});
	
	function leftMenu(id,url){
		//清空菜单
		var panels = $('#nav').accordion('panels');
		if(panels.length>0){
			var panelsLength=panels.length;
			for(i=panelsLength-1;i>=0;i--){
				var t = panels[i].panel('options').title;
		    	$('#nav').accordion('remove', t);
			}
		}
		//显示菜单
		$.each(menus,function(i,n){
			if(n.pid==id){
				var menulist='';
				menulist +='<ul>';
				$.each(menus, function(j, o) {
					if(o.pid==n.id)
						menulist += '<li><div><a ref="'+o.id+'" href="#" rel="' + o.url + '" ><span class="icon '+o.icon+'" >&nbsp;</span><span class="nav">' + o.name + '</span></a></div></li> ';
				});
				menulist += '</ul>';
				
				$('#nav').accordion('add', {
		            title: n.name,
		            content: menulist,
		            iconCls: 'icon ' + n.icon
		        });
			}
		});
		//选中第一个
		panels = $('#nav').accordion('panels');
		if(panels.length>0){
			var t = panels[0].panel('options').title;
	    	$('#nav').accordion('select', t);
		}
	}
</script>
<style type="text/css">
.nav ul{
	list-style-type:none;
	margin:0px;/*也可以简写为margin:0 auto*/
}
.nav ul li{
	float:left;/*让li元素左浮动*/
}

.nav ul li a{
	width:80px;/*设置元素宽*/
	height:35px;/*设置高度*/
	line-height:35px;/*设置行距为28px，让文字在每行的中间位置*/
	background:red;/*设置元素的背景为红色*/
	color:#FFF;/*文字颜色是白色*/
	margin:0px;
	display:block;/*这个比较关键，因为a本身就是联级元素，本身不具有宽高，用这个把它变成块级元素，这样前面设置的宽和高就能起作用了*/
	text-align:center;/*让文本居中*/
	text-decoration:none; /*去掉下划线*/
}
</style>
</head>

<body class="easyui-layout">
<noscript>
<div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;line-height: 20px;color: #fff;">
    <img src="images/noscript.gif" alt='抱歉，请开启脚本支持！' />
</div>
</noscript>
<!-- 头部 -->
<div region="north" split="true" border="false" style="height: 40px;background-color: #D2E0F2" class="nav">
	 <span style="padding-left:10px; font-size: 16px; width:200px;">企信通-后台管理</span>
	 <span style="float:right;" id="topMenu">
	     <ul>
	       <li><a href="#">权限管理</a></li>
	       <li><a href="#">自动生成</a></li>
	       <li><a href="#">自动生成</a></li>
	       <li><a href="#">About</a></li>
	       <li><a href="#">Contact</a></li>
	     </ul>
     </span>
	<!-- 
	<span style="padding-left:10px; font-size: 16px; ">企信通-后台管理</span>
	<span style="float:right; padding-right:20px;color:white;text-decoration:underline;" id="topMenu">
		<a href="javascript:void(0)" onclick="showMenu('${ctx}/adminManage/sys/menu/menuSys.jsp')">权限管理</a>
		<a href="javascript:void(0)" onclick="showMenu('${ctx}/adminManage/sys/menu/menuAuto.jsp')">自动生成</a>
		<a href="javascript:void(0)" onclick="showMenu('${ctx}/adminManage/sys/menu/menuRun.jsp')">运行监控</a>
	</span>
	-->
</div>
<!-- 底部版本说明 -->
<div region="south" split="true" style="height: 30px; background: #D2E0F2; ">
    <div style="text-align:center;color:#15428B; margin:0px; padding:0px;line-height:23px; font-weight:bold;">By <a href="http://www.shareinfo.com.cn/" target="_blank">深圳协尔</a>(QQ:94300452)</div>
</div>
<!-- 菜单导航 -->
<div region="west" hide="true" split="true" title="导航菜单" style="width:180px;" id="west">
	<div id="nav" class="easyui-accordion" fit="true" border="false">
	<!--  导航内容 -->
		
	</div>
</div>
<!-- 内容显示  -->
<div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden">
	<div id="tabs" class="easyui-tabs" fit="true" border="false">
		<div title="欢迎使用" style="padding:20px;overflow:hidden; color:red; " >
				<h1 style="font-size:24px;">* 作者：黄鹏 QQ：94300452</h1>
			</div>
	</div>
</div>
</body>
</html>